import "@/views/login/index.less";

import { useSelector, useDispatch } from "react-redux";
import { decrement, increment } from "@/redux/counterSlice";

const Login = () => {
  const count = useSelector((state: any) => state.counter.value);
  const people = useSelector((state: any) => state.counter.people);
  const dispatch = useDispatch();
  return (
    <div className='login-container'>
      <div>数量:{count}</div>
      <button
        aria-label='Increment value'
        onClick={() => dispatch(increment())}
      >
        Increment
      </button>
      <button
        aria-label='Decrement value'
        onClick={() => dispatch(decrement())}
      >
        Decrement
      </button>
      <div>{people.name}</div>
    </div>
  );
};

export default Login;
